#ifndef CURVETABLEMODEL_H
#define CURVETABLEMODEL_H

#include <QAbstractTableModel>

#include "Point.h"
#include <QSharedPointer>

class CurveTableModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    CurveTableModel(QObject *parent = nullptr);
    ~CurveTableModel();

    void SetHeaders(const QStringList headers);
    void SetShowPoints(const QList<QSharedPointer<Point>> &showPoints);
    void Update();

protected:
    int rowCount(const QModelIndex& parent = QModelIndex()) const override;
    int columnCount(const QModelIndex& parent = QModelIndex()) const override;
    QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
    QVariant headerData(int section, Qt::Orientation orientation, int role) const override;

private:
    QStringList headers;
    QList<QSharedPointer<Point>> showPoints;
};

#endif // CURVETABLEMODEL_H
